﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MeshClusterTool : MonoBehaviour
{
    // 需要Cluster的Mesh
    public Mesh meshToBeClusterred;
    // 被切分的Mesh的Index，每个Block的大小是8*8
    


    void Start()
    {
        
    }

    void Update()
    {
        
    }

    public void ClusterMesh()
    {
        Debug.Log(meshToBeClusterred.subMeshCount);
        Vector3[] mVertices = meshToBeClusterred.vertices;
        Debug.Log(mVertices.Length);
        for (int i = 0; i < meshToBeClusterred.subMeshCount; ++i)
        {
            Debug.Log("subMeshIdx = " + i);
            int[] mIndices = meshToBeClusterred.GetIndices(i);
            Debug.Log(mIndices.Length);
            int[] mTriangles = meshToBeClusterred.GetTriangles(i);
            Debug.Log(mTriangles.Length);
        }
    }

}
